package cn.wolfcode.trip.base.mapper;

import cn.wolfcode.trip.base.domain.StrategyComment;
import cn.wolfcode.trip.base.query.QueryObject;
import cn.wolfcode.trip.base.query.StrategyCommentQueryObject;
import com.github.pagehelper.PageInfo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface StrategyCommentMapper {
    int deleteByPrimaryKey(Long id);

    int insert(StrategyComment entity);

    /**
     * 根据评论id获取评论评论信息以及评论的用户信息和对应的评论攻略信息
     * @param id
     * @return
     */
    StrategyComment selectByPrimaryKey(Long id);

    List<StrategyComment> selectAll();

    int updateByPrimaryKey(StrategyComment entity);

    List<StrategyComment> selectForList(StrategyCommentQueryObject qo);

    void inserRelation(@Param("strategyCommentId") Long strategyCommentId,
                       @Param("tagId") Long tagId);

    /**
     * 查询单个用户所有的攻略的一级评论
     * @param qo
     * @return
     */
    List selectForListByUserId(StrategyCommentQueryObject qo);
}